home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / tcltk / tk8.5 / obsolete.tcl < prev    next >
Encoding:
Text File  |  2009-11-17  |  5.4 KB  |  179 lines

  1. # obsolete.tcl --
  2. #
  3. # This file contains obsolete procedures that people really shouldn't
  4. # be using anymore, but which are kept around for backward compatibility.
  5. #
  6. # RCS: @(#) $Id: obsolete.tcl,v 1.4 2007/12/13 15:26:27 dgp Exp $
  7. #
  8. # Copyright (c) 1994 The Regents of the University of California.
  9. # Copyright (c) 1994 Sun Microsystems, Inc.
  10. #
  11. # See the file "license.terms" for information on usage and redistribution
  12. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13. #
  14.  
  15. # The procedures below are here strictly for backward compatibility with
  16. # Tk version 3.6 and earlier.  The procedures are no longer needed, so
  17. # they are no-ops.  You should not use these procedures anymore, since
  18. # they may be removed in some future release.
  19.  
  20. proc tk_menuBar args {}
  21. proc tk_bindForTraversal args {}
  22.  
  23. # ::tk::classic::restore --
  24. #
  25. # Restore the pre-8.5 (Tk classic) look as the widget defaults for classic
  26. # Tk widgets.
  27. #
  28. # The value following an 'option add' call is the new 8.5 value.
  29. #
  30. namespace eval ::tk::classic {
  31.     # This may need to be adjusted for some window managers that are
  32.     # more aggressive with their own Xdefaults (like KDE and CDE)
  33.     variable prio "widgetDefault"
  34. }
  35.  
  36. proc ::tk::classic::restore {args} {
  37.     # Restore classic (8.4) look to classic Tk widgets
  38.     variable prio
  39.  
  40.     if {[llength $args]} {
  41.     foreach what $args {
  42.         ::tk::classic::restore_$what
  43.     }
  44.     } else {
  45.     foreach cmd [info procs restore_*] {
  46.         $cmd
  47.     }
  48.     }
  49. }
  50.  
  51. proc ::tk::classic::restore_font {args} {
  52.     # Many widgets were adjusted from hard-coded defaults to using the
  53.     # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...)
  54.     # For restoring compatibility, we only correct size and weighting changes,
  55.     # as the fonts themselves remained mostly the same.
  56.     if {[tk windowingsystem] eq "x11"} {
  57.     font configure TkDefaultFont -weight bold ; # normal
  58.     font configure TkFixedFont -size -12 ; # -10
  59.     }
  60.     # Add these with prio 21 to override value in dialog/msgbox.tcl
  61.     if {[tk windowingsystem] eq "aqua"} {
  62.     option add *Dialog.msg.font system 21; # TkCaptionFont
  63.     option add *Dialog.dtl.font system 21; # TkCaptionFont
  64.     option add *ErrorDialog*Label.font system 21; # TkCaptionFont
  65.     } else {
  66.     option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont
  67.     option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont
  68.     option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont
  69.     }
  70. }
  71.  
  72. proc ::tk::classic::restore_button {args} {
  73.     variable prio
  74.     if {[tk windowingsystem] eq "x11"} {
  75.     foreach cls {Button Radiobutton Checkbutton} {
  76.         option add *$cls.borderWidth 2 $prio; # 1
  77.     }
  78.     }
  79. }
  80.  
  81. proc ::tk::classic::restore_entry {args} {
  82.     variable prio
  83.     # Entry and Spinbox share core defaults
  84.     foreach cls {Entry Spinbox} {
  85.     if {[tk windowingsystem] ne "aqua"} {
  86.         option add *$cls.borderWidth    2 $prio; # 1
  87.     }
  88.     if {[tk windowingsystem] eq "x11"} {
  89.         option add *$cls.background        "#d9d9d9" $prio; # "white"
  90.         option add *$cls.selectBorderWidth    1 $prio; # 0
  91.     }
  92.     }
  93. }
  94.  
  95. proc ::tk::classic::restore_listbox {args} {
  96.     variable prio
  97.     if {[tk windowingsystem] ne "win32"} {
  98.     option add *Listbox.background        "#d9d9d9" $prio; # "white"
  99.     option add *Listbox.activeStyle        "underline" $prio; # "dotbox"
  100.     }
  101.     if {[tk windowingsystem] ne "aqua"} {
  102.     option add *Listbox.borderWidth        2 $prio; # 1
  103.     }
  104.     if {[tk windowingsystem] eq "x11"} {
  105.     option add *Listbox.selectBorderWidth    1 $prio; # 0
  106.     }
  107.     # Remove focus into Listbox added for 8.5
  108.     bind Listbox <1> {
  109.     if {[winfo exists %W]} {
  110.         tk::ListboxBeginSelect %W [%W index @%x,%y]
  111.     }
  112.     }
  113. }
  114.  
  115. proc ::tk::classic::restore_menu {args} {
  116.     variable prio
  117.     if {[tk windowingsystem] eq "x11"} {
  118.     option add *Menu.activeBorderWidth    2 $prio; # 1
  119.     option add *Menu.borderWidth        2 $prio; # 1
  120.     }
  121.     if {[tk windowingsystem] ne "aqua"} {
  122.     option add *Menu.font        "TkDefaultFont" $prio; # "TkMenuFont"
  123.     }
  124. }
  125.  
  126. proc ::tk::classic::restore_menubutton {args} {
  127.     variable prio
  128.     option add *Menubutton.borderWidth    2 $prio; # 1
  129. }
  130.  
  131. proc ::tk::classic::restore_message {args} {
  132.     variable prio
  133.     option add *Message.borderWidth    2 $prio; # 1
  134. }
  135.  
  136. proc ::tk::classic::restore_panedwindow {args} {
  137.     variable prio
  138.     option add *Panedwindow.borderWidth    2 $prio; # 1
  139.     option add *Panedwindow.sashWidth    2 $prio; # 3
  140.     option add *Panedwindow.sashPad    2 $prio; # 0
  141.     option add *Panedwindow.sashRelief    raised $prio; # flat
  142.     option add *Panedwindow.opaqueResize    0 $prio; # 1
  143.     if {[tk windowingsystem] ne "win32"} {
  144.     option add *Panedwindow.showHandle    1 $prio; # 0
  145.     }
  146. }
  147.  
  148. proc ::tk::classic::restore_scale {args} {
  149.     variable prio
  150.     option add *Scale.borderWidth    2 $prio; # 1
  151.     if {[tk windowingsystem] eq "x11"} {
  152.     option add *Scale.troughColor    "#c3c3c3" $prio; # "#b3b3b3"
  153.     }
  154. }
  155.  
  156. proc ::tk::classic::restore_scrollbar {args} {
  157.     variable prio
  158.     if {[tk windowingsystem] eq "x11"} {
  159.     option add *Scrollbar.borderWidth    2 $prio; # 1
  160.     option add *Scrollbar.highlightThickness 1 $prio; # 0
  161.     option add *Scrollbar.width        15 $prio; # 11
  162.     option add *Scrollbar.troughColor    "#c3c3c3" $prio; # "#b3b3b3"
  163.     }
  164. }
  165.  
  166. proc ::tk::classic::restore_text {args} {
  167.     variable prio
  168.     if {[tk windowingsystem] ne "aqua"} {
  169.     option add *Text.borderWidth    2 $prio; # 1
  170.     }
  171.     if {[tk windowingsystem] eq "win32"} {
  172.     option add *Text.font        "TkDefaultFont" $prio; # "TkFixedFont"
  173.     }
  174.     if {[tk windowingsystem] eq "x11"} {
  175.     option add *Text.background        "#d9d9d9" $prio; # white
  176.     option add *Text.selectBorderWidth    1 $prio; # 0
  177.     }
  178. }
  179.